import {request} from '@/uilts/request.js'
// const token = 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjNiMWIxMzZhLTUyZWYtNDdmYS1iZDI3LTMxNjRjNjk1MjUyYyJ9.CwEMw5BtOigKTfBbyOn6_ikUUESlEw5dERIkS_cVNzDWx7ZuiwP3N4mqhcKJ-Z-cMyHaKtfVgw7BMJJYSa1JRw'
//登录接口
export function getLogin(data){
	return request({
		url:'/user/login',
		method:'POST',
		data,
		header:{
			//不需要token
			isToken:true
		}
	})
}
//获取所有商品
export function getAllStore(){
	return request({
		url:'/lzs/goods/list',
		method:'GET',
		header:{
			//需要token
			isToken:false
		}
	})
}
//查询商品详情
export function getDetail(data){
	return request({
		url:'/lzs/goods/list?goodsId='+data,
		method:'GET',
		header:{
			//需要token
			isToken:false
		}
	})
}
//查询首页图片
export function getMainPic(){
	return request({
		url:'/lzs/home/picture',
		method:'GET',
		header:{
			//需要token
			isToken:false
		}
	})
}
//查询商品类别
export function getQueryrCommodityCategory(){
	return request({
		url:'/lzs/goods/categoryList',
		method:'GET',
		header:{
			//需要token
			isToken:false
		}
	})
}
//新增订单而且是口袋
export function getAddPocket(data){
	return request({
		url:'/lzs/order',
		method:'post',
		data,
		header:{
			//需要token
			isToken:false
		}
	})
}
//查询用户信息
export function getInformation(){
	return request({
		url:'/user/getAvatarUrl',
		method:'GET',
		header:{
			//需要token
			isToken:false
		}
	})
}
//修改用户信息
export function updateInformation(data){
	return request({
		url:'/user/update',
		method:'put',
		data,
		header:{
			//需要token
			isToken:false
		}
	})
}
//新增收餐地址
export function addAddress(data){
	return request({
		url:'/address/add',
		method:'POST',
		data,
		header:{
			//需要token
			isToken:false
		}
	})
}
//查询用户收餐地址
export function getUserAddress(){
	return request({
		url:'/address/select',
		method:'GET',
		header:{
			//需要token
			isToken:false
		}
	})
}
//删除收餐信息
export function delUserAddress(data){
	return request({
		url:'/address/del?address='+data,
		method:'DELETE',
		header:{
			//需要token
			isToken:false
		}
	})
}
//获取全部订单
export function getAllOrder(){
	return request({
		url:'/lzs/order/list',
		method:'GET',
		header:{
			//需要token
			isToken:false
		}
	})
}
//查询未评价的订单
export function QueryOrdersNotEvaluated(){
	return request({
		url:'/order/selectComment',
		method:'GET',
		header:{
			//需要token
			isToken:false
		}
	})
}
//根据orderId获取订单详情
export function getOrderDetail(params){
	return request({
		url:'/lzs/order/'+params,
		method:'GET',
		header:{
			//需要token
			isToken:false
		}
	})
}
//查询类别中商品
export function QueryCategory(params){
	return request({
		url:'/lzs/goods/category?categoryId='+params,
		method:'GET',
		params,
		header:{
			//需要token
			isToken:false
		}
	})
}
//查询用户收藏
export function QueryUserCollection(){
	return request({
		url:'/collect/select',
		method:'GET',
		header:{
			//需要token
			isToken:false
		}
	})
}
//新增用户收藏
export function addUserCollection(data){
	return request({
		url:'/collect/add?goodsId='+data,
		method:'POST',
		data,
		header:{
			//需要token
			isToken:false
		}
	})
}
//删除收藏信息
export function delUserCollection(data){
	return request({
		url:'/collect/del?collectId='+data,
		method:'DELETE',
		data,
		header:{
			//需要token
			isToken:false
		}
	})
}
//评论订单，修改订单状态
export function CommentOrder(data){
	return request({
		url:'/lzs/order',
		method:'put',
		data,
		header:{
			//需要token
			isToken:false
		}
	})
}
//根据orderId获取退款订单
export function GetRefundOrder(data){
	return request({
		url:'/lzs/refund/'+data,
		method:'get',
		header:{
			//需要token
			isToken:false
		}
	})
}